const customConfig = require("app-config")
const env: any = process.env


let appConfig = {
  name: '顺丰贷后管理系统',
  version: 'V4.0.0',
  url: {
    server: env.URL.SERVER,
    attach: env.URL.ATTACH
  },
  rabbitmq: {
    socket: env.RABBITMQ.SOCKET,
    vhost: env.RABBITMQ.VHOST,
    username: env.RABBITMQ.USERNAME,
    password: env.RABBITMQ.PASSWORD,
    exchange: env.RABBITMQ.EXCHANGE
  },
  timeout: 300000,
  debug: env.BUILD_ENV === 'dev', // ,
  // 身份证号和手机号脱敏开关
  encryptSwitch: true,
  // rootSite: "https://finance.sf-pay.com/finance-oms/login.html"
  // rootSite: "http://finance-sit.sf-pay.com:8090/finance-oms/login.html"
  rootSite: env.RABBITMQ.LOGINURL
}

// 如果存在自定义配置则启用自定义配置
if (customConfig && customConfig.enable) {
  appConfig = { ...appConfig, ...customConfig.config }
}

export default appConfig
